home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / comm / cnet / fpcnet.lha / fpfiles / fpcnet / FPCNET next >
Text File  |  1996-07-12  |  3KB  |  41 lines

  1. /**************************************************************************^
  2.         $VER: FPCNetText Downloader, v1.00 (10-Jul-96) by Dotoran!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch
  6. a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
  7.  
  8. bcost=50    /* DL byte cost of file in percent (size of file * bcost)     */
  9. fcost=0     /* DL file cost of file in files                              */
  10. schat=0     /* 0=Available at all prompts, 1=only available in Sysop Chat */
  11.  
  12. gu 1209644;nu=result;gu 2407246;max=result;if nu=max then do
  13.   tr "n1c6You have c9NO c6room in your ceSelect Bufferc6!";exit;end
  14. sch=bbsline(1,931);getwhere;if schat & result~=sch then do;gu 1302246
  15.   tr 'n1c6Unknown command cf"cb'result'cf" c6... enter ca? c6for quick help.';exit;end
  16. gu 2107333;tset=result /* Use Multiple Text Sets: 0=No, 1=User, 2=Port */
  17. se "n1cbMark c6"word("the some",(tset>0)+1)" ceBBSTEXTc6/ceBBSMENU c6files for cadownload c7[c9Noc7]c6? "
  18. gc;if result~="Y" then do;tr "c9Noc6.";exit;end;else tr "caYesc6!n1"
  19. select;when tset=1 then do;bbstm=BMTXT(23);do a=0 to bbstm;tr "cf"right(a,3)"cb. ca"bmt.a;end
  20.   se "n1c6Enter the ceBBSTEXTc6/ceBBSMENU cb# c6you want to cddownloadc9: c7[cb0c6-cb"bbstm"c7]c6? cbL1305640 #0}I16452 2}"
  21.   gu 70;an=result;if ~datatype(an,"W")|an<0|an>bbstm then exit;if an=0 then an="";end
  22.   when tset=2 then do;gu 23;an=result;if an=0 then an="";end;otherwise an="";end
  23. bbsidentify name;bbs=result;gu 2307314;tf=left(result,2)"_CNET"an".LHA"
  24. gu 39;result="mail:users/"result"/";tpf=result||tf;call delete(tpf)
  25. se "n1cdPacking c6the ceBBSTEXTcb"an"c7/ceBBSMENUcb"an"c6... cfPlease waitc6..."
  26. address command "lha -I -b64 -m -Qw -Qo a "tpf" CNET:BBSTEXT"an" CNET:BBSMENU"an;address command "filenote "tpf' "'bbs" BBSTEXT"an"/BBSMENU"an'"'
  27. if SELFILE(tpf,bcost,fcost,2) then;tr 'b1cbDonen2c6The file was added to your ceSelect Buffer c6as cf"cd'tf'cf"c6...';exit
  28. SELFILE:;arg np,bco,fco,ki;gu 1209644;nu=result;gu 2407246;if nu=result then return 0
  29.   pa=left(np,max(lastpos(":",np),lastpos("/",np)));na=substr(np,length(pa)+1);si=word(statef(np),2)
  30.   sh=x2c(d2x(si,8))left(na,32,"00"x)left(pa,96,"00"x)copies("00"x,7)
  31.   sh=sh||x2c(d2x(ki,2))x2c(d2x(si*bco%100,8))x2c(d2x(fco,4))copies("00"x,6)copies("FF"x,4)
  32.   getcarrier;if result~="TRUE" then exit;gu 1401978;call export(x2c(d2x(result+nu*156,8)),sh)
  33.   setobject nu+1;putuser 1209644;return 1
  34. BMTXT:;b=ARG(1)*2;gu 2401064;t=import(x2c(d2x(result,8)),220);parse var t 13 p +4 =b+21 s +2 =b+121 l +2;c=0
  35.   do a=c2d(s) to (c2d(s)+c2d(l)-1);m=import(import(offset(p,4*a),4),512);parse var m t"00"x;bmt.c=translate(t,"\{","");c=c+1;end;return c-1
  36. BBSLINE:;arg ty,li;gu 1402018+(ty*4);ln=import(import(offset(x2c(d2x(result,8)),(li-1)*4),4),1024);parse var ln ln'00'x .;return ln
  37. SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')';e2='  Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960;b=result;c='"'a||b'"';e2=e2' 'c
  38.   tr e1;tr e2;logentry e1;logentry e2;e=sourceline(sigl);do while e~='';e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
  39. /**************************************************************************\
  40. \****************************************** Frontiers BBS (716)/823-9892 **/
  41.